import {ipcMain} from 'electron'
import WindowsManager from './class/Win.class'
import WinURL from './class/WinURL.class'

export function getMainWindow() {
    WindowsManager.createMainWindow(WinURL.main);
}
export function getCreateWindow() {
    WindowsManager.createArticleWindow(WinURL.article)
}

ipcMain.on('to-mainWindow', (event, arg) => {
    WindowsManager.mainWindow.loadURL(WinURL.main);
})

ipcMain.on('to-loginWindow', (event, arg) => {
    WindowsManager.mainWindow.loadURL(WinURL.login);
})

ipcMain.on('to-createArticleWindow', (event, arg) => {
    console.log(WinURL.article + arg)
    WindowsManager.createArticleWindow(WinURL.article + arg);
})


